using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace HsVoice
{
    /// <summary>
    /// 作者：zhuconglin
    /// 时间：01/10/2024
    /// 说明: 通过websocket接入火山引擎智能语音模块
    /// 注意：C#属于小端，火山引擎是大端
    /// </summary>
    public class HsEngineVoice
    {
        public AudioSource source;
        private HsSynthWS synthWs = new HsSynthWS();
        //识别
        public void Transcri()
        {
          
        }

        public void LinkHsSynth()
        {
            synthWs.LinkHsSynth();
        }

        public void DislinkHsSynth()
        {
            synthWs.DislinkHsSynth();
        }
        
        //合成
        public void DoSynth(int id, string content,EVoice voice,EEmotion emotion = EEmotion.happy,ELanguage lan = ELanguage.cn)
        {
            if (HsTools.IsExist(id))
            {
                synthWs.handle.LoadAudio(id);
            }
            else
            {
                synthWs.handle.taskid = id;
                var request = HsReqBuilder.BuildSynthRequest(content, voice, emotion, lan);
                synthWs.SynthRequest(request);
                
            }
           
        }

      
    }
}

